package com.seanLab.web;

import com.seanLab.domain.Article;
import com.seanLab.domain.Body;
import com.seanLab.domain.Image;
import com.seanLab.service.ArticleService;
import com.seanLab.service.ImageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;

import java.util.Collection;

/**
 * Created by ailly on 17-8-28.
 */
@CrossOrigin(origins = "*", maxAge = 3600)
@RestController
@RequestMapping("/v1/images")
public class ImageController {
    @Autowired
    private ImageService imageService;

    @RequestMapping(method = RequestMethod.GET )
    public Collection<Image> getAllImages() {
        return this.imageService.getAllImages();
    }

//    @RequestMapping(method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
//    public Body insertImage(@RequestBody Image image) {
//        return this.imageService.insertImage(image);
//
//    }

}